﻿Public Module mdlConexion
    Public cmd As New Data.OleDb.OleDbCommand
    Public conexion As New Data.OleDb.OleDbConnection
    Public Sub dbStart()
        Dim stringConexion As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\dbtp3.accdb;Persist Security Info=False"
        Dim data As New DataTable
        cmd.CommandType = CommandType.Text
        cmd.Connection = conexion
        conexion.ConnectionString = stringConexion
        conexion.Open()
    End Sub
    Public Sub dbCommit(ByVal sql As String) ' lo que hace esto es ejecutar el comando 
        cmd.CommandType = CommandType.Text
        cmd.CommandText = sql
        cmd.Connection = conexion
        cmd.ExecuteNonQuery()
        dbClosed()
    End Sub
    Public Sub dbClosed()
        conexion.Close()
    End Sub
End Module
